<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style>
        /* 全局背景和样式 */
        body {
            font-family: 'Arial', sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f5f5f5;
            color: #333;
            height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        /* 主容器 */
        .container {
            width: 100%;
            max-width: 1150px; /* 增大面板宽度 */
            background-color: #fff;
            border-radius: 10px;
            box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
            padding: 30px;
            overflow: auto;
            max-height: 80vh;
            box-sizing: border-box;
        }

        /* 表格样式 */
        table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 20px;
            table-layout: fixed;  /* 固定表格布局 */
        }

        th, td {
            text-align: left;
            padding: 12px;
            word-wrap: break-word;  /* 自动换行 */
            overflow: hidden;
            text-overflow: ellipsis;  /* 超长文本显示省略号 */
        }

        th {
            background-color: #4CAF50;
            color: white;
            font-weight: bold;
            font-size: 14px;
            text-transform: uppercase;
        }

        td {
            background-color: #f9f9f9;
            color: #555;
        }

        tr:nth-child(even) td {
            background-color: #f1f1f1;
        }

        tr:hover td {
            background-color: #e8f5e9;
            transition: background-color 0.3s ease;
        }

        /* 设置列宽比例 */
        th:nth-child(1), td:nth-child(1) {
            width: 15%;  /* Field 列宽度占 25% */
        }

        th:nth-child(2), td:nth-child(2) {
            width: 85%;  /* Value 列宽度占 75% */
        }

        /* 页脚样式 */
        .footer {
            margin-top: 20px;
            text-align: center;
            font-size: 12px;
            color: #888;
        }

        .footer a {
            color: #4CAF50;
            text-decoration: none;
        }

        .footer a:hover {
            text-decoration: underline;
        }

        /* 响应式设计 */
        @media screen and (max-width: 768px) {
            table {
                font-size: 14px;
            }

            th, td {
                padding: 10px;
            }

            th:nth-child(1), td:nth-child(1) {
                width: 30%;  /* 更小屏幕下 Field 列稍微增宽 */
            }

            th:nth-child(2), td:nth-child(2) {
                width: 70%;  /* Value 列稍微减少宽度 */
            }
        }
    </style>
</head>
<body>

<!-- 主容器 -->
<div class="container">
    <!-- 表格展示 -->
    <table>
        <thead>
        <tr>
            <th>Field</th>
            <th>Value</th>
        </tr>
        </thead>
        <tbody>
        <?php if (is_object($res)) $res = get_object_vars($res); ?>
        <?php foreach ($res as $key => $value): ?>
        <tr>
            <td><?= htmlspecialchars($key) ?></td>
            <td><?= htmlspecialchars(is_null($value) ? 'N/A' : $value) ?></td>
        </tr>
        <?php endforeach; ?>
        </tbody>
    </table>

    <!-- 页脚 -->
    <div class="footer">
        <p>Powered by <a href="#">Your Application</a> &middot; <?= date('Y') ?></p>
    </div>
</div>

</body>
</html>

